<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件修饰符</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <h2>欢迎{{name}}</h2>
        <a href="http:www.baidu.com" @click.prevent="showInfo">点我提示信息</a>
        <!--prevent阻止默认事件发生-->
    </div>
</body>

<script>
    new Vue({
        el:'#root',
        data:{
          name:'Gui'
        },
        methods:{
            showInfo(){
                alert('你好')
            }
        }
    })
</script>

</html>